#ifndef TCPOUTPUTSTREAM_H
#define TCPOUTPUTSTREAM_H

#include <winsock2.h>
const int MAX_LEN(4096);

class TCPOutputStream
{
public:
	TCPOutputStream(SOCKET socket);
	TCPOutputStream(const char *addr, int port);
	~TCPOutputStream();
	void close();
	int write(const char* buf, int len);
	int flush();
private:
	char m_buffer[MAX_LEN+1];
	int m_len;
	SOCKET m_socket;
};
#endif
